package com.gupaoedu.dubbo;

import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.rpc.Protocol;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("dubbo-client.xml");

        IGupaoHello iGupaoHello = (IGupaoHello)context.getBean("helloGupao");

        System.out.println(iGupaoHello.sayHello("Nicky"));

        Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).
                getExtension("myNewProtocol");

        System.out.println("myNewProtocol 的端口为：" + protocol.getDefaultPort());

    }
}
